Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot API 8.0 #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Bot API 8.0 #73

wants to merge 1 commit into from

Conversation

telepath-companion[bot]
Copy link

Bot API 8.0

Bot API 8.0 introduces 10 powerful new features for Mini Apps - including the ability to enter full-screen mode, launch from home screen shortcuts, offer subscription plans and more. Check out all the details in our dedicated blog and Mini App documentation.
[~]
Star Subscriptions

  • Bots now support paid subscriptions powered by Telegram Stars - monetizing their efforts with multiple tiers of content and features.
  • Added the parameter subscription_period to the method createInvoiceLink to support the creation of links that are billed periodically.
  • Added the parameter business_connection_id to the method createInvoiceLink to support the creation of invoice links on behalf of business accounts.
  • Added the fields subscription_expiration_date , is_recurring and is_first_recurring to the class SuccessfulPayment .
  • Added the method editUserStarSubscription .
  • Added the field subscription_period to the class TransactionPartnerUser .
    Full-screen Mode
  • Mini Apps are now able to become full-screen in both portrait and landscape mode - allowing them to host more games , play widescreen media and support immersive user experiences.
  • Added the methods requestFullscreen and exitFullscreen to the class WebApp to toggle full-screen mode.
  • Added the fields safeAreaInset and contentSafeAreaInset to the class WebApp , allowing Mini Apps to ensure that their content properly respects the device's safe area margins.
  • Further added the fields isActive and isFullscreen to the class WebApp .
  • Added the events activated , deactivated , safeAreaChanged , contentSafeAreaChanged , fullscreenChanged and fullscreenFailed for Mini Apps.
    Homescreen Shortcuts
  • Mini Apps can now be accessed via direct shortcuts added to the home screen of mobile devices.
  • Added the method addToHomeScreen to the class WebApp to create a shortcut for users to add to their home screens.
  • Added the method checkHomeScreenStatus to the class WebApp to determine the status and support of the home screen shortcut for the Mini App on the current device.
  • Added the events homeScreenAdded and homeScreenChecked for Mini Apps.
    Emoji Status
  • Mini Apps can now prompt users to set their emoji status - or request access to later sync it automatically with in-game badges, third-party APIs and more.
  • Added the method setUserEmojiStatus . The user must allow the bot to manage their emoji status.
  • Added the method setEmojiStatus to the class WebApp to let users manually confirm a custom emoji as their new status via a native dialog.
  • Added the method requestEmojiStatusAccess to the class WebApp for obtaining permission to later update a user's emoji status via the Bot API method setUserEmojiStatus .
  • Added the events emojiStatusSet , emojiStatusFailed and emojiStatusAccessRequested for Mini Apps.
    Media Sharing and File Downloads
  • Users can now share media directly from Mini Apps - sending referral codes , custom memes, artwork and more to any chat or posting them as a story .
  • Added the class PreparedInlineMessage and the method savePreparedInlineMessage , allowing bots to suggest users to send a specific message from a Mini App via the method shareMessage .
  • Added the method shareMessage to the class WebApp to share media from Mini Apps to Telegram chats.
  • Added the method downloadFile to the class WebApp , introducing support for a native popup that prompts users to download files from the Mini App.
  • Added the events shareMessageSent , shareMessageFailed and fileDownloadRequested for Mini Apps.
    Geolocation Access
  • Mini Apps can now request geolocation access to users, allowing them to build virtually any location-based service, from games with dynamic points of interest to interactive maps for events.
  • Added the field LocationManager to the class WebApp .
  • Added the events locationManagerUpdated and locationRequested for Mini Apps.
    Device Motion Tracking
  • Mini Apps can now track detailed device motion data , allowing them to implement better productivity tools, immersive VR experiences and more.
  • Added the fields isOrientationLocked , Accelerometer , DeviceOrientation and Gyroscope to the class WebApp .
  • Added the methods lockOrientation and unlockOrientation to the class WebApp to control the screen orientation.
  • Added the events accelerometerStarted , accelerometerStopped , accelerometerChanged , accelerometerFailed , deviceOrientationStarted , deviceOrientationStopped , deviceOrientationChanged , deviceOrientationFailed , gyroscopeStarted , gyroscopeStopped , gyroscopeChanged , gyroscopeFailed for Mini Apps.
    Gifts
  • Bots can now send Paid Gifts to users in exchange for Telegram Stars.
  • Added the classes Gift and Gifts and the method getAvailableGifts , allowing bots to get all gifts available for sending.
  • Added the method sendGift , allowing bots to send gifts to users.
  • Added the field gift to the class TransactionPartnerUser .
    Loading Screen Customization
  • Mini Apps can customize their loading screen, adding their own icon and specific colors for light and dark themes.
  • You can access these customization settings in @BotFather via /mybots > Select Bot > Bot Settings > Configure Mini App > Enable Mini App
    Hardware-specific Optimizations
  • Mini Apps running on Android can now receive basic information about a device's processing hardware, allowing them to optimize user experience based on the device's capabilities.
  • This information includes the OS, App and SDK's respective versions as well as the device's model and performance class.
    General
  • Added the field photo_url to the class WebAppUser for all bots, allowing Mini Apps to access a user's profile photo if their privacy settings allow for it.
  • Third parties (e.g., Mini App builders) that receive or process data on behalf of Mini Apps are now able to validate it without knowing the App's bot token .
  • Debugging options have been expanded to include full support for iOS devices . You can use these tools to find app-specific issues in your Mini App.
    [~]

WARNING! Starting December 1, 2024 messages with video that are sent, copied or forwarded to groups and channels with a sufficiently large audience can be automatically scheduled by the server until the respective video is reencoded. Such messages will have 0 as their message identifier and can't be used before they are actually sent.
[~]

@telepath-companion telepath-companion bot added auto-generated Reflects auto-generated code changes bot api Telegram Bot API related WTD Enable What The Diff comments labels Nov 22, 2024
Copy link

what-the-diff bot commented Nov 22, 2024

PR Summary 🎉

  • Switched the gift type to a more appropriate one! 🎁
    We've changed the "$gift" property type from an uncertain string to an uncertain Gift. This simply means we're becoming more specific about what kind of "gift" we want to use. It's as if we were saying, "Hmmm... we're not entirely sure we'll have a gift, but if we do, it better be a 'Gift' type not just any string."

  • Improved our gift-making method's ingredient list! 🏭
    Similar to above, for our 'make' method (think of it as a secret gift factory), we've been more specific with what kind of 'gift' we want to feed it. Instead of an uncertain string, we're now using the upgraded uncertain 'Gift'. This small tweak helps everyone know what sort of gift our method expects when it starts making magic! 🎩✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-generated Reflects auto-generated code changes bot api Telegram Bot API related WTD Enable What The Diff comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant